package com.aceitunaproject.shared.util;

/**
 * Object serializer interface for serializing and deserializing
 * objects sent between the client and the server
 * 
 * @author Maciej Miechowicz
 */
public interface ObjectSerializer {

	/**
	 * Serializes the given object into byte array data
	 * 
	 * @param object object to serialize
	 * @return serialized data
	 * @throws RuntimeException if an error during serialization occurs
	 */
	public byte[] serialize(Object object);
	
	/**
	 * Deserializes the given byte array data into an object
	 * 
	 * @param data data to deserialize
	 * @return deserialized object
	 * @throws RuntimeException if an error during deserialization occurs
	 */
	public Object deserialize(byte[] data);
	
}
